{% extends 'base.html' %}
{% block content %}
    <style>
        .whole {
            font-weight: bolder;
            padding-top: 10px;
        }

        .others {
            color: #2b669a;
            margin-left: 40px;
            margin-top: -20px;;

        }

        .others > a {
            border: darkgray solid 1px;
            padding: 3px;
            margin: 2px;
            text-underline: none;

        }

        .active {
            color: white;
            background-color: #337ab7;
            border: white solid 1px;
        }
    </style>
    <div class="col-md-10 pull-right">
        {#    组合搜索页面展示#}
        {% if search_group_row_list %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    快速筛选
                </div>
                <div class="panel-body">
                    {% for row in  search_group_row_list %}
                        <div>
                            {% for field in row %}
                                {{ field|safe }}
                            {% endfor %}
                        </div>
                    {% endfor %}
                </div>
            </div>
        {% endif %}

        {#    关键字搜索#}
        {% if search_list %}
            <div class="form-group" style="float: right;" >
                <div class="form-inline">
                    <form method="get" action="">
                        <input type="text" class="form-control" value="{{ search_value }}" name='q' placeholder="输入关键词">
                        <span style="margin-left: -20px" class="input-group-btn form-inline pull-right">
            <button class="btn btn-primary
            glyphicon glyphicon-search" type="submit" style="margin-top: -2px"></button>
          </span>
                    </form>
                </div>
            </div>
        {% endif %}
        <form method="post">
            {% csrf_token %}
            {% if action_dict %}
                <div style="float: left">
                    <div class="form-group">
                        <div class="form-inline">
                            <select name="action" class="form-control">
                                <option>请选择操作</option>
                                {% for func_name,func_text in action_dict.items %}
                                    <option value="{{ func_name }}">{{ func_text }}</option>
                                {% endfor %}

                            </select>
                            <input type="submit" class="btn btn-primary" value="执行">
                        </div>
                    </div>
                </div>
            {% endif %}
            <div style="margin-bottom: 10px;">
                {% if add_btn %}
                    {{ add_btn|safe }}
                {% endif %}
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>序号</th>
                    {% for header in header_list %}
                        <th>{{ header }}</th>
                    {% endfor %}
                </tr>
                </thead>
                <tbody>
                {% for items  in tr_list %}
                    <tr>
                        <td>{{ forloop.counter }}</td>
                        {% for foo in items %}
                            <td>{{ foo }}</td>
                        {% endfor %}
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </form>
    </div>

{% endblock %}